<script>
import { mapMutations } from 'vuex';
export default {
	methods: {
		...mapMutations(['login']) // 对全局的方法进行监听
	},
	onLaunch: function () {
		let token = uni.getStorageSync('token');
		let store = uni.getStorageSync('store');
		if (token) {
			this.login({
				store: store,
				token: token
			}); // 更新登录状态， 保持登录状态
		} else {
			uni.reLaunch({
				url: '/pages/login/index'
			});
		}
	}
};
</script>

<style lang="scss">
@import '@/static/styles/iconfont.css';
@import '@/static/styles/contentmixin.scss';
@import '@/uni_modules/uview-ui/index.scss';
</style>
